# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""adding table datastore_profiles

Revision ID: b1d1e7ab5dec
Revises: 28383af526f3
Create Date: 2023-06-30 13:42:19.974990

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "b1d1e7ab5dec"
down_revision = "28383af526f3"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "datastore_profiles",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=255, collation="utf8_bin"), nullable=True),
        sa.Column(
            "project", sa.String(length=255, collation="utf8_bin"), nullable=True
        ),
        sa.Column("type", sa.String(length=255, collation="utf8_bin"), nullable=True),
        sa.Column("body", sa.String(length=1024, collation="utf8_bin"), nullable=True),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("name", "project", name="_datastore_profiles_uc"),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("datastore_profiles")
    # ### end Alembic commands ###
